;;;
;;;
;;;	Author:
;;;		Henry C. Francis
;;;		425 N. Ashe St.
;;;		Southern Pines, NC 28387
;;;
;;;     http://paracadd.com
;;;	All rights reserved.
;;;
(DEFUN check_for_doslib ()
  (IF debug_pads ;indents debug text upon entering this function
    (IF (>= (STRLEN debug_pads) 15)
      (SETQ debug_pads (SUBSTR debug_pads 1 15))
      (SETQ debug_pads (STRCAT debug_pads "\t"))
    )
    (SETQ debug_pads "\t")
  )
  (IF debug_check_for_doslib
    (PROGN
      (PRINC (STRCAT "\n" debug_pads "CHECK_FOR_DOSLIB: Begin execution of function. "))
      (PRINC)
    ) ;_ end of PROGN
  ) ;_ end of IF
  (COND
                                        ;if DOSLib is already loaded, return true
    ((NOT (NULL DOS_ABOUT))
     (SETQ nodoslib nil)
     T
    )
                                        ;if AutoCAD Release 12, 
    ((AND
       (= (ATOI (SUBSTR (GETVAR "acadver") 1 2)) 12)
       (FINDFILE "doslib12.arx")
     )
     (SETQ nodoslib nil)
     (xload "doslib12")
    )
                                        ;if AutoCAD Release 13, 
    ((AND
       (= (ATOI (SUBSTR (GETVAR "acadver") 1 2)) 13)
       (FINDFILE "doslib13.arx")
     )
     (SETQ nodoslib nil)
     (xload "doslib13" nil)
    )
                                        ;if AutoCAD Release 14, 
    ((AND (= (ATOI (SUBSTR (GETVAR "acadver") 1 2)) 14)
          (NOT DOS_HELP)
          (FINDFILE "doslib14.arx")
     ) ;_ end of and
     (SETQ nodoslib nil)
     (ARXLOAD "doslib14")
    )
                                        ;if AutoCAD 2000, 
    ((AND (= (ATOF (GETVAR "acadver")) 15)
          (NOT DOS_HELP)
          (FINDFILE "doslib15.arx")
     ) ;_ end of and
     (SETQ nodoslib nil)
     (ARXLOAD "doslib15")
    )
    ((AND (>= (ATOF (GETVAR "acadver")) 16)
	  (< (ATOF (GETVAR "acadver")) 17.0)
          (NOT DOS_HELP)
          (FINDFILE "doslib16.arx")
     ) ;_ end of and
     (SETQ nodoslib nil)
     (ARXLOAD "doslib16")
    )
    ((AND (>= (ATOF (GETVAR "acadver")) 17.0)
	  (< (ATOF (GETVAR "acadver")) 18.0)
          (NOT DOS_HELP)
	  (OR
            (FINDFILE "doslib17.arx")
	    (FINDFILE "doslib17x64.arx")
	  )
     ) ;_ end of and
     (SETQ nodoslib nil)
     (IF (WCMATCH (STRCASE (GETVAR "platform")) "*(X64)*")
       (ARXLOAD "doslib17x64")
       (ARXLOAD "doslib17")
     )
    )
    ((AND (>= (ATOF (GETVAR "acadver")) 18.0)
	  (< (ATOF (GETVAR "acadver")) 19.0)
          (NOT DOS_HELP)
	  (OR
            (FINDFILE "doslib18.arx")
	    (FINDFILE "doslib18x64.arx")
	  )
     ) ;_ end of and
     (SETQ nodoslib nil)
     (IF (WCMATCH (STRCASE (GETVAR "platform")) "*(X64)*")
       (ARXLOAD "doslib18x64")
       (ARXLOAD "doslib18")
     )
    )
    ((AND (>= (ATOF (GETVAR "acadver")) 19.0)
	  (< (ATOF (GETVAR "acadver")) 20.0)
          (NOT DOS_HELP)
	  (OR
            (FINDFILE "doslib19.arx")
	    (FINDFILE "doslib19x64.arx")
	  )
     ) ;_ end of and
     (SETQ nodoslib nil)
     (IF (WCMATCH (STRCASE (GETVAR "platform")) "*(X64)*")
       (ARXLOAD "doslib19x64")
       (ARXLOAD "doslib19")
     )
    )
    ((AND (>= (ATOF (GETVAR "acadver")) 20.0)
	  (< (ATOF (GETVAR "acadver")) 21.0)
          (NOT DOS_HELP)
	  (OR
            (FINDFILE "doslib20.arx")
	    (FINDFILE "doslib20x64.arx")
	  )
     ) ;_ end of and
     (SETQ nodoslib nil)
     (IF (WCMATCH (STRCASE (GETVAR "platform")) "*(X64)*")
       (ARXLOAD "doslib20x64")
       (ARXLOAD "doslib20")
     )
    )
    ((AND (>= (ATOF (GETVAR "acadver")) 21.0)
	  (< (ATOF (GETVAR "acadver")) 22.0)
          (NOT DOS_HELP)
	  (OR
            (FINDFILE "doslib21.arx")
	    (FINDFILE "doslib21x64.arx")
	  )
     ) ;_ end of and
     (SETQ nodoslib nil)
     (IF (WCMATCH (STRCASE (GETVAR "platform")) "*(X64)*")
       (ARXLOAD "doslib21x64")
       (ARXLOAD "doslib21")
     )
    )
    (nodoslib
     (PROMPT "\nDOSLIB not found! ")
     (IF (SETQ found-doslib-zip (FINDFILE "DosLIB.zip"))
         					;if DosLIB.zip exists alert user
       (ALERT
         (STRCAT
           "DOSLIB is required by ParaPOINT.\n"
           "It is necessary to unzip "
           found-doslib-zip
           " placing the contents in the same folder to enable DOSLIB."
         )
       )
         					;if there is no DOSLIB alert user
       (ALERT (STRCAT
                "This application requires DOSLIB by Robert McNeel & Associates.  Free to download here:\n"
                "http://www.mcneel.com/\n\n"
                "DOSLib, is a library of AutoLISP-callable functions that provides a variety of Windows "
                "operating system capabilities to AutoCAD. Written as an AutoCAD ObjectARX application, "
                "DOSLib extends AutoLISP to provide the following functions:\n\n"
                
                "Drives:       \tCheck for drives, change between drives, and check\n"
                	      "\t\tavailable disk space.\n"
                "Paths:        \tManipulate path specifications.\n"
                "Folders:      \tCreate, rename, remove, select, and change folders.\n"
                	      "\t\tReturn special operating system folders.\n"
                "Files:        \t\tCopy, delete, move, rename, and select files; get directory\n"
               		      "\t\tlistings, search and find multiple instances of files,\n"
              		      "\t\tand change file attributes.\n"
                "Print:        \t\tGet and set default printers, and spool print files.\n"
                "Configuration:\tManipulate Windows-style initialization (INI) files,\n"
                	      "\t\tand access the Windows Registry.\n"
                "Processes:    \tRun internal OS commands or other programs.\n"
                "Interface:    \tGet strings, integers, reals, and lists from the user.\n"
                	      "\t\tDisplay Windows message boxes, progress meters, and splash screens.\n"
                "Strings:      \tTokenize strings, extract characters, find characters, insert,\n"
                	      "\t\tremove, and replace characters, and trim characters.\n"
                "AutoCAD:      \tSave all and close all open files. Preview drawings and list xrefs.\n"
                "System:       \tGet system information, sort lists, change the system date and time,\n"
                	      "\t\tmanipulate the keyboard, and play sounds."
              )
       )
    ))
  ) ;_ end of cond
  (IF debug_check_for_doslib
    (PROGN
      (PRINC (STRCAT "\n" debug_pads "CHECK_FOR_DOSLIB: End execution of function. "))
      (PRINC)
    ) ;_ end of PROGN
  ) ;_ end of IF
  (IF debug_pads ;unindents debug text upon leaving this function
    (SETQ debug_pads (SUBSTR debug_pads 2))
  )
  (princ)
) ;_ end of DEFUN
